package run.siyuan.rocketmq.consumer;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.annotation.SelectorType;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

import static run.siyuan.common.constant.rocketmq.Constants.Group;
import static run.siyuan.common.constant.rocketmq.Constants.Topic;

/**
 * @className: RocketMqConsumerTagFilter2
 * @Description: TODO 标签过滤 tag_simple_sync_a
 * @author: siyuan
 * @date: 2022/5/24 10:39 AM
 */
@Slf4j
@Component
@RocketMQMessageListener(topic = Topic.TOPIC_SIMPLE_SYNC,
        selectorType = SelectorType.TAG,
        selectorExpression = "tag_simple_sync_a",
        consumerGroup = Group.CONSUMER_GROUP_NAME_SYNC+3)
public class RocketMqConsumerTagFilter2 implements RocketMQListener<String> {

    @Override
    public void onMessage(String messageBody) {
        log.info("{} 收到消息：{}", this.getClass().getSimpleName(), messageBody);
    }
}
